import java.util.Scanner;
import java.lang.Math;
public class ArrayNeighbNumbers
{
	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);
		System.out.print("Please enter The dimension of your array: ");
		String number = input.next();
		int checknumber=0;
   		try 
   		{
   			checknumber = Integer.parseInt(number);
   		}
   			catch (NumberFormatException e) 
   		{
       		System.err.println("Sorry but the argument must be an integer." +
                              " Please re-run the program and provide integer number.");
       		System.exit(1);
   		}
   		if (checknumber > 20)
   		{
   			System.err.println("Sorry but dimension greater then " + checknumber + 
                              " is a bit complicated for manual enering. Please try something lower after program re-run");
       		System.exit(1);
   		}
   		int[] array = new int[checknumber];
   		for (int i=0; i<=(array.length-1); i++)
   		{
   			array[i]=input.nextInt();
   		}
   		int difference=difference = Math.abs(array[1] - array[0]);
   		int desired_index=0;
   		for (int i=0; i<=(array.length-2); i++)
   		{
   			if (Math.abs(array[i+1] - array[i])<difference)
   			{
   				difference = Math.abs(array[i+1] - array[i]);
   				desired_index = i;
   			}
   			else difference = difference;
   		}
   		System.out.println("The smallest difference is " + difference + " and its index in the array is " + desired_index);
	}
}